//package com.swanclouds.redfish.account.domain.builder;
//
//import com.fasterxml.jackson.annotation.JsonProperty;
//import com.fasterxml.jackson.core.JsonProcessingException;
//import com.fasterxml.jackson.databind.ObjectMapper;
//import com.google.common.collect.Lists;
//import com.swanclouds.model.account.builder.LdapControllerBuilder;
//import com.swanclouds.model.account.builder.LdapGroupBuilder;
//
//import java.util.List;
//
//public class LdapControllerConcreteBuilder implements LdapControllerBuilder {
//
//    @JsonProperty("LdapServerAddress")
//    private String ldapServerAddress;
//    @JsonProperty("LdapPort")
//    private Integer ldapPort;
//    @JsonProperty("UserDomain")
//    private String userDomain;
//    @JsonProperty("BindDN")
//    private String bindDN;
//    @JsonProperty("BindPassword")
//    private String bindPassword;
//    @JsonProperty("CertificateVerificationEnabled")
//    private Boolean certificateVerificationEnabled;
//    @JsonProperty("CertificateVerificationLevel")
//    private String crtificateVerificationLevel;
//    @JsonProperty("LdapGroups")
//    private List<LdapGroupBuilder> ldapGroups;
//
//    private LdapControllerConcreteBuilder() {}
//
//    public static LdapControllerBuilder builder() {
//        return new LdapControllerConcreteBuilder();
//    }
//
//    @Override
//    public LdapControllerBuilder LdapServerAddress(String address) {
//        this.ldapServerAddress = address;
//        return this;
//    }
//
//    @Override
//    public LdapControllerBuilder LdapPort(Integer port) {
//        this.ldapPort = port;
//        return this;
//    }
//
//    @Override
//    public LdapControllerBuilder UserDomain(String userDomain) {
//        this.userDomain = userDomain;
//        return this;
//    }
//
//    @Override
//    public LdapControllerBuilder BindDN(String bindDN) {
//        this.bindDN = bindDN;
//        return this;
//    }
//
//    @Override
//    public LdapControllerBuilder BindPassword(String bindPassword) {
//        this.bindPassword = bindPassword;
//        return this;
//    }
//
//    @Override
//    public LdapControllerBuilder CertificateVerificationEnabled(Boolean certificateVerificationEnabled) {
//        this.certificateVerificationEnabled = certificateVerificationEnabled;
//        return this;
//    }
//
//    @Override
//    public LdapControllerBuilder CertificateVerificationLevel(String certificateVerificationLevel) {
//        this.crtificateVerificationLevel = certificateVerificationLevel;
//        return this;
//    }
//
//    @Override
//    public LdapControllerBuilder LdapGroups(List<LdapGroupBuilder> ldapGroups) {
//        if (ldapGroups == null) {
//            return this;
//        }
//        if (this.ldapGroups == null) {
//            this.ldapGroups = Lists.newArrayList();
//        }
//        ldapGroups.stream().forEach(group -> {
//            this.ldapGroups.add(group);
//        });
//        return this;
//    }
//
//    @Override
//    public LdapControllerBuilder AddLdapGroup(LdapGroupBuilder ldapGroup) {
//        if (this.ldapGroups == null) {
//            this.ldapGroups = Lists.newArrayList();
//        }
//        if (ldapGroup == null) {
//            return this;
//        }
//        this.ldapGroups.add(ldapGroup);
//        return this;
//    }
//
//    @Override
//    public String toString() {
//        ObjectMapper objectMapper = new ObjectMapper();
//        try {
//            return objectMapper.writeValueAsString(this);
//        } catch (JsonProcessingException e) {
//        }
//        return "LdapControllerConcreteBuilder {" +
//                "ldapServerAddress='" + ldapServerAddress + '\'' +
//                ", ldapPort=" + ldapPort +
//                ", userDomain='" + userDomain + '\'' +
//                ", bindDN='" + bindDN + '\'' +
//                ", bindPassword='" + bindPassword + '\'' +
//                ", certificateVerificationEnabled=" + certificateVerificationEnabled +
//                ", crtificateVerificationLevel='" + crtificateVerificationLevel + '\'' +
//                ", ldapGroups=" + ldapGroups +
//                '}';
//    }
//}